using UnityEngine;

public class GlobalInf : MonoBehaviour
{
	public static bool loading_over;

	public static bool gameover = false;

	public static PlayerAtt CurPlayerAtt = new PlayerAtt();

	public static TASKMODE gamemode = TASKMODE.level;

	public static int CurrentLevel = 0;

	public static int chanllengeid = 8;

	public static int chanllenge_mode = 0;

	public static bool menuuifirst = false;

	public static bool gamefirst = false;

	public static bool isInternalInjury = false;

	public static PLANECTRLTYPE PlaneCtrlType;

	public static bool ismusic = true;

	public static bool issfx = true;

	public static bool isinverty = false;

	public static bool ishavespeedsmoke = false;

	public static float screenRatioWidth = 480f * (float)Screen.width / (float)Screen.height;

	public static float ratioReltoUI = (float)Screen.height / 480f;

	private static bool issetbegin = true;

	public static int width;

	public static int height;

	public static int memory;

	public static int graphicMemory;

	public static Vector3 centerpoint;

	public static int flyrange_AI = 4000;

	public static int flyrange = 8000;

	public static string[] ai_names = new string[20]
	{
		"Bengal",
		"Patel",
		"Nicky",
		"Mike",
		"McGuire",
		"Caesar",
		"Grace",
		"Hope",
		"Diana",
		"Zoe",
		"Lisa",
		"Mary",
		"Nicole",
		"Odin",
		"Paula",
		"Queen",
		"Rita",
		"Bonnie",
		"Terry",
		"Lol"
	};

	public static string[] fri_names = new string[20]
	{
		"James",
		"Eva",
		"Doolittle",
		"DaoPing",
		"Edward",
		"Felix",
		"Gary",
		"Hugo",
		"Carl",
		"Zac",
		"Leo",
		"Mirical",
		"Notail",
		"Otto",
		"Paul",
		"Qwer",
		"Rotk",
		"Sama",
		"BurNing",
		"Dotaer"
	};

	public static string[] tips = new string[8]
	{
		"每个敌人面前都有一个瞄准点。控制十字准线瞄准它。",
		"导弹无法 100% 命中目标。找到合适的时机。",
		"有时候，在空战中与敌人拉开距离会更容易获胜。",
		"当你觉得难以击落敌人时，尝试升级你的装备",
		"航母会不断产生敌方飞机，优先摧毁它。",
		"穿越峡谷时减速，这样会更容易。",
		"减速并找到合适的角度，你甚至可以在跑道上着陆。",
		"你可以在挑战模式中获得钻石，别错过。"
	};

	public static bool hasInit = false;

	private static Quality currentQuality = Quality.Low;

	public static Quality CurrentQuality
	{
		get
		{
			if (!hasInit)
			{
				DetectQuality();
			}
			return currentQuality;
		}
	}

	public static void SetBegin()
	{
		if (!issetbegin)
		{
			return;
		}
		if (CurrentQuality < (Quality)150)
		{
			ismusic = false;
			issfx = false;
			ishavespeedsmoke = false;
		}
		else
		{
			if (PlayerPrefs.GetInt("ismusic", 1) == 1)
			{
				ismusic = true;
			}
			else
			{
				ismusic = false;
			}
			if (PlayerPrefs.GetInt("issfx", 1) == 1)
			{
				issfx = true;
			}
			else
			{
				issfx = false;
			}
			if (graphicMemory < 100)
			{
				ishavespeedsmoke = false;
			}
			else
			{
				ishavespeedsmoke = true;
			}
		}
		if (PlayerPrefs.GetInt("isinverty", 0) == 0)
		{
			isinverty = false;
		}
		else
		{
			isinverty = true;
		}
		if (PlayerPrefs.GetInt("controltype", 0) == 0)
		{
			PlaneCtrlType = PLANECTRLTYPE.BUTTON;
		}
		else
		{
			PlaneCtrlType = PLANECTRLTYPE.GRAVITY;
		}
		issetbegin = false;
	}

	private static void DetectQuality()
	{
		width = Screen.width;
		height = Screen.height;
		memory = SystemInfo.systemMemorySize;
		graphicMemory = SystemInfo.graphicsMemorySize;
		hasInit = true;
		if (width < 321 && height < 241)
		{
			if (memory < 350 || graphicMemory < 140)
			{
				currentQuality = Quality.Worst;
			}
			else
			{
				currentQuality = Quality.Low;
			}
		}
		else if (width <= 481 && height < 321)
		{
			if (graphicMemory < 65)
			{
				currentQuality = Quality.Worst;
			}
			else if (memory + graphicMemory <= 512)
			{
				currentQuality = Quality.Low;
			}
			else
			{
				currentQuality = Quality.Medium;
			}
		}
		else if (graphicMemory + memory < 257)
		{
			currentQuality = Quality.Worst;
		}
		else if (graphicMemory + memory <= 512)
		{
			currentQuality = Quality.Low;
		}
		else if (graphicMemory + memory <= 1500)
		{
			currentQuality = Quality.Medium;
		}
		else
		{
			currentQuality = Quality.High;
		}
		if (currentQuality > Quality.Low)
		{
			Shader.globalMaximumLOD = 301;
		}
		else
		{
			Shader.globalMaximumLOD = 201;
		}
	}
}
